using System.ComponentModel.DataAnnotations.Schema;
using System.Data.Entity.ModelConfiguration;

namespace ConsoleApplication2.Models.Mapping
{
    public class SM_INDUSTRYMap : EntityTypeConfiguration<SM_INDUSTRY>
    {
        public SM_INDUSTRYMap()
        {
            // Primary Key
            this.HasKey(t => t.ID);

            // Properties
            this.Property(t => t.Name)
                .HasMaxLength(50);

            this.Property(t => t.Code)
                .HasMaxLength(10);

            // Table & Column Mappings
            this.ToTable("SM_INDUSTRY");
            this.Property(t => t.ID).HasColumnName("ID");
            this.Property(t => t.Name).HasColumnName("Name");
            this.Property(t => t.Code).HasColumnName("Code");
            this.Property(t => t.Protected).HasColumnName("Protected");
        }
    }
}
